UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+BGKWdyfYKTNe/Jf4+Dk+FTg/ZCk1IpzM3GfzAaqjLs='
WHERE
key_id = 'ee9e18743f55622759c9b58831e9da400b7be3f9df7f577f9f8825c5a6200c7a'
AND (
token = '+BGKWdyfYKTNe/Jf4+Dk+FTg/ZCk1IpzM3GfzAaqjLs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)