UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/xReHZyYAHfR4iiPsCR8UFwCecTnHwxKAsVbmfmpLac=' 
WHERE 
  key_id = 'af120d87d2ebbd7f2385ccfcf4752b4279ff44f39329fee2b6271343f75c0111' 
  AND (
    token = '/xReHZyYAHfR4iiPsCR8UFwCecTnHwxKAsVbmfmpLac=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021