UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aq/8nP8uA7pD7m/GE1BIeMIqg3/7Vw8AKaRB5wiVjPE='
WHERE
key_id = '81653c8ae8e5795622fcd76a9abb06d8b534d61722c7e8b81a2486c66993b1b9'
AND (
token = 'aq/8nP8uA7pD7m/GE1BIeMIqg3/7Vw8AKaRB5wiVjPE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)