UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L1kmazRclMx6wPswaMdN46lZDvuEMYmJHAEiqwqtdT0=' 
WHERE 
  key_id = '381f13cc7ef9fb9feba66a43e8b4aa3277be63114bc769988664c96953e8fa4a' 
  AND (
    token = 'L1kmazRclMx6wPswaMdN46lZDvuEMYmJHAEiqwqtdT0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041