UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yiYJAOd+tr2a8WYbXP+fkTf3TcYJNtNGVSNqWcvijyA=' 
WHERE 
  key_id = '8edb4b8e4744621d7fadaca609c98930a4c8d21ea4af9c48db702b30eb6cf53d' 
  AND (
    token = 'yiYJAOd+tr2a8WYbXP+fkTf3TcYJNtNGVSNqWcvijyA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025