UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ueX6ZeF79Hv2dA/0NHCGy+OhFXzO17h3pRSZjPLej10=' 
WHERE 
  key_id = '93f7312912bb50d0327278623ee8d4e91bf5d43c7a45cf1e4e8503af70990619' 
  AND (
    token = 'ueX6ZeF79Hv2dA/0NHCGy+OhFXzO17h3pRSZjPLej10=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024