UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uN6MKmH4YDlk5wPfBW9Uez4gjN9AkrFLbAkuSDkzxL0=' 
WHERE 
  key_id = '5efee27e08e42cd7b802d076f65b36db3d7fad127ecdecc4e76a8ad5c0d5a527' 
  AND (
    token = 'uN6MKmH4YDlk5wPfBW9Uez4gjN9AkrFLbAkuSDkzxL0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025