UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Fub1KVKm1c1saWG5/w9koBl7W1hWgCRLETh3+k5hNf8=' 
WHERE 
  key_id = '833cc2e0722e5bc3b2bf5b1e060bae526774dc128eb0657dfd71ab0c3004996f' 
  AND (
    token = 'Fub1KVKm1c1saWG5/w9koBl7W1hWgCRLETh3+k5hNf8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030