UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fKbiIUjPEXKG7J5Y34Kn8EHhdKg8K69Z6S7IEsxiGwc='
WHERE
key_id = '7553636f0cf236666df3c8aaa216f15b426d39ce7740c15f8172dfb53b4061fa'
AND (
token = 'fKbiIUjPEXKG7J5Y34Kn8EHhdKg8K69Z6S7IEsxiGwc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)