UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zH3beHV3hxVbn0Apr6D1VhpjPzDmwK16sCGDhhomtoQ=' 
WHERE 
  key_id = '469cafbda245e74e0c01992fa2c9616d7619424d98ec1922ba02407f1500c1ac' 
  AND (
    token = 'zH3beHV3hxVbn0Apr6D1VhpjPzDmwK16sCGDhhomtoQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00066