UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zK9Sa44kySsVT5RW/BV+RMfXeXjf7u+HIM6Ewob5L3I='
WHERE
key_id = '5b1043a324e596c62001bd33611eebd682d5ae84c25e6dbc8b6ddf6cce087a2a'
AND (
token = 'zK9Sa44kySsVT5RW/BV+RMfXeXjf7u+HIM6Ewob5L3I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)