UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5dkqExtnRsdnceTwwEGnBrj+VGHa4E2JdUMOiOtG9HM='
WHERE
key_id = '3e6421199f733d432ad32467308a9016d42f46117fd3d4e1e0cdab64245cc0d5'
AND (
token = '5dkqExtnRsdnceTwwEGnBrj+VGHa4E2JdUMOiOtG9HM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)