UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SSV+8/LTjA5vN/AOYNW6ZGHMH3+cEQ//hNOpQQ9DXn0='
WHERE
key_id = '98ef2738096d276f9c4661f150c1c518b9cbab8cab74d4e498db6f88d34fbcad'
AND (
token = 'SSV+8/LTjA5vN/AOYNW6ZGHMH3+cEQ//hNOpQQ9DXn0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)