UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JYJddXny4vWtMi9t2UUyp1edPHeePc0I3jqey5yi09Q='
WHERE
key_id = '6f1797014193c1678d0dd2ad0760b1a3b8193b8315222882721a4b77b8886ff0'
AND (
token = 'JYJddXny4vWtMi9t2UUyp1edPHeePc0I3jqey5yi09Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)