UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6yCgrfnGIEXC07Upo4WkaxCuqNtVdVxsSr/rBJaVmnM=' 
WHERE 
  key_id = '673af7cbe3fee27796cb25199ad9f5b124439170823dc8c027344a4b0330c4d7' 
  AND (
    token = '6yCgrfnGIEXC07Upo4WkaxCuqNtVdVxsSr/rBJaVmnM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029