UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4qjmktdg1VsaPZWYGomDqzIUBW+/BCOcZwPl+Bn4i3E=' 
WHERE 
  key_id = '5ecccfe214572a4cd2b169920ef05f5c6d06a9d020e000efe53abcc5c354715b' 
  AND (
    token = '4qjmktdg1VsaPZWYGomDqzIUBW+/BCOcZwPl+Bn4i3E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025