UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7FmBz1+ur/cBXoYxpbwWglfkGk1Ff/2bfwqwZwjpBg8='
WHERE
key_id = 'bb71644bbdeeb703d388729de9e324242a1e5841c6aaf58b27565fde0b3feee0'
AND (
token = '7FmBz1+ur/cBXoYxpbwWglfkGk1Ff/2bfwqwZwjpBg8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)