UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uRnV94Fox1wAiz6orfHY3ytviLSt8Oc1SuF1z2DxQpw=' 
WHERE 
  key_id = '3a946e748660e876f69b461fa440c74b81f0721d98f49c5c86d73a83335d8321' 
  AND (
    token = 'uRnV94Fox1wAiz6orfHY3ytviLSt8Oc1SuF1z2DxQpw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044