UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tbNl6F8FnbRZF6ZLmnmBHLaysfiCeDVWQZfGGp0/6Ac='
WHERE
key_id = '9db422239cb5dc31888090cb1f34af64b1ff510ca4f40a39bf87d57069423e12'
AND (
token = 'tbNl6F8FnbRZF6ZLmnmBHLaysfiCeDVWQZfGGp0/6Ac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)