UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vvE/IJO8Nud1JYkTVhBBS4jhuC/1fOI6gt8mvvE38w8=' 
WHERE 
  key_id = '1a406d233c0fbe5ec552e2c32a08a7873aafae8207e2fee7005f01f398384381' 
  AND (
    token = 'vvE/IJO8Nud1JYkTVhBBS4jhuC/1fOI6gt8mvvE38w8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022