UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oFMhYuhhlcGz0wk7RqzctpqSRNDwGi1xS3Oh7mteagg=' 
WHERE 
  key_id = 'dd8ecb030dbe198c2ac9c3c8f2c0d95b58c81647cb609bdd8102b6496ba6052a' 
  AND (
    token = 'oFMhYuhhlcGz0wk7RqzctpqSRNDwGi1xS3Oh7mteagg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049