UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xt4mylfU5ktRxO72xjYRO91sY9+leJk486u6t/zF1xw=' 
WHERE 
  key_id = 'aea760d57fba72d0331c7f8df5e38970780833eb58bd17afa6d3b7dda0382eec' 
  AND (
    token = 'xt4mylfU5ktRxO72xjYRO91sY9+leJk486u6t/zF1xw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035