UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WVddOgqv4nHyq0rcqLvkpAPu2RT+d3eilDPvxKuaKYA='
WHERE
key_id = '549abf63cd20154c1480e27d8b227fd0b588fa36c947296aee28871250862d87'
AND (
token = 'WVddOgqv4nHyq0rcqLvkpAPu2RT+d3eilDPvxKuaKYA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)