UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YMVhLEq8GF+zUsnzMz+QbUH5Ih3/99U9zD1mh87k6JE=' 
WHERE 
  key_id = '780e4cc2e98d23b50c5c93e325a70861560fcbcf4c8771e7877f26b825cd1c4d' 
  AND (
    token = 'YMVhLEq8GF+zUsnzMz+QbUH5Ih3/99U9zD1mh87k6JE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027