UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UIHYalUn1jBYwM+h2LFR/IHEkjv0nel4NoYpFXtuMIY=' 
WHERE 
  key_id = 'acca6915bfab9aa24562d28c92130b714bb56a029274fc2870de022d2b35219b' 
  AND (
    token = 'UIHYalUn1jBYwM+h2LFR/IHEkjv0nel4NoYpFXtuMIY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026