UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8V8pZ9/m8ViKGF6kgAAy2qWK1FsGf9wpbNEjdM/vV1A=' 
WHERE 
  key_id = 'c64b0545191dad5a920a08a1ee084e69a99507cf32f694b7d629e275ec410660' 
  AND (
    token = '8V8pZ9/m8ViKGF6kgAAy2qWK1FsGf9wpbNEjdM/vV1A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042