UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ip+zXXurJQJNoweWHsBXtIIsaueZfhzLhiJ9VYgguzI='
WHERE
key_id = '889961c35508f49d87d05ef5b4dc9dac15d5cc0171e5ee457d89973949c08f6e'
AND (
token = 'ip+zXXurJQJNoweWHsBXtIIsaueZfhzLhiJ9VYgguzI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)