UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4KsliTcv0tz0KffoTVbCKSUTJb3Aa7xmKc/ZjzUekek='
WHERE
key_id = 'a01729e2e0c61e3285a9744c444be26a64e8eb26c2b694dc338b72d271601dff'
AND (
token = '4KsliTcv0tz0KffoTVbCKSUTJb3Aa7xmKc/ZjzUekek='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)