UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bLWQo4/3SRB/NaQWHRSdeXEkyxhdklGSL7az/d/RQqY=' 
WHERE 
  key_id = '4d340d5aa157bc25d45f97b79532d3e855f004964f36b1aa4ae33705e4bf18ab' 
  AND (
    token = 'bLWQo4/3SRB/NaQWHRSdeXEkyxhdklGSL7az/d/RQqY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038