UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9xyrmApIpnH0rlnyhYWHgl4dNq4VACFosf0OOTMaP5k=' 
WHERE 
  key_id = 'cd6a001048c71a93dd0a3e6c94258b51d69f17c2cb1e49de24083454442115ac' 
  AND (
    token = '9xyrmApIpnH0rlnyhYWHgl4dNq4VACFosf0OOTMaP5k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025