UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2OUD2mfmk4KSTb54A1jH+PjLeCVmxfiCkmRIv9K3BTI=' 
WHERE 
  key_id = 'd704831ad9360d0a8a27bbfa9bd2091296a36d3a2d27ce3c5d32d5f552f4e5b6' 
  AND (
    token = '2OUD2mfmk4KSTb54A1jH+PjLeCVmxfiCkmRIv9K3BTI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038