UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ukEvCUQ6ufG762lMPXG+VojHDKpmiLh0RA2GTR7V1yA=' 
WHERE 
  key_id = '2d4439893d0860947d38dff5decd1e5f1d8b68d3bf8d9209b645c13ae160b4b1' 
  AND (
    token = 'ukEvCUQ6ufG762lMPXG+VojHDKpmiLh0RA2GTR7V1yA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020