UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x0tPkZhMHOIN0fEX63FzJxhA00b3GKzbMyblv7nEB9g=' 
WHERE 
  key_id = '3d63485b05c722235163fd93300e305bd8c0cbd274844058af96eb11ddf4756e' 
  AND (
    token = 'x0tPkZhMHOIN0fEX63FzJxhA00b3GKzbMyblv7nEB9g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045