UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QUUi3Di/MrmDk6iGqQVQq8C8OO8ocvobMcMvr2KcgkA='
WHERE
key_id = '479bc0a6757e04d95ad3ad10f87f5ffae63f577e6d939c670694d918ab693593'
AND (
token = 'QUUi3Di/MrmDk6iGqQVQq8C8OO8ocvobMcMvr2KcgkA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)