UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ArzPla7U75AMu8aUe47IqBDZtak/ID03koOPACEe9v8=' 
WHERE 
  key_id = '2aa47a66e1963768b2ad335284d782f1d3be1404dab4277db6a8f832149da4f7' 
  AND (
    token = 'ArzPla7U75AMu8aUe47IqBDZtak/ID03koOPACEe9v8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037