UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c5q3Z3ayKxHVD4ZIEWhqY3goz4XqsR/cKnXgVIO31YE=' 
WHERE 
  key_id = '36d8acaa4696a3e723714f216ca7f9373c3faa590b53e4db9694ade293116527' 
  AND (
    token = 'c5q3Z3ayKxHVD4ZIEWhqY3goz4XqsR/cKnXgVIO31YE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033