UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x0rImNilAChnQiyZySLTT1HzwMOjHebpjXeu+3Ilm2o=' 
WHERE 
  key_id = '4a2cd1d1aa0ecd8a3e4f73daf94dcd40b4dd23c8d993884155dea15608caed8b' 
  AND (
    token = 'x0rImNilAChnQiyZySLTT1HzwMOjHebpjXeu+3Ilm2o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035