UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/NLLDbyrWsA39OlVDXHzmtA7ZQa9+6ajuIm6Ixu2+1c=' 
WHERE 
  key_id = '095028fc749de894faf77180544b689500a141f8beb76947c9f15c7aa734d7e7' 
  AND (
    token = '/NLLDbyrWsA39OlVDXHzmtA7ZQa9+6ajuIm6Ixu2+1c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021