UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/lzWYYob3zOSbaObGKoPF8pR2jrGilOPbvVwe0Jl3hk='
WHERE
key_id = 'a3ade0bfc6badf0991ea1662107fff9a7b574d12acaf389690df6e3303bd0e2f'
AND (
token = '/lzWYYob3zOSbaObGKoPF8pR2jrGilOPbvVwe0Jl3hk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)