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

Query time 0.00037