UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iFAh2tMlBaA6fWNvOXRQhhAtLYdS1r3P6sX0QPy6GGU='
WHERE
key_id = '5ccb69eccaf125102ba0f70e2ac5a6265b8e06f3e2dbb1bf8dab16f5fc2398ab'
AND (
token = 'iFAh2tMlBaA6fWNvOXRQhhAtLYdS1r3P6sX0QPy6GGU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)