UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AO0Mt8s9N6XCcSGlL7johXECjcH9a7C+yuApVFMeGEA=' 
WHERE 
  key_id = '14fb14887292745d05a45acd41bc05691dd0e917e4b1cd0d1bd006b8f3344c06' 
  AND (
    token = 'AO0Mt8s9N6XCcSGlL7johXECjcH9a7C+yuApVFMeGEA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014