UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tQEtGIxG+Rvq4ab9FcllXVXDLfLCw1Rctju/1KBlw1c=' 
WHERE 
  key_id = '95cef3f15aeac17f1b69412bcaffea4f177996efd74991c1d0cb51520352be29' 
  AND (
    token = 'tQEtGIxG+Rvq4ab9FcllXVXDLfLCw1Rctju/1KBlw1c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045