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

Query time 0.00025