UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KywRPui7aSpghZUfB6XxwdXysO/wsJmpp+6W/0MWMAA='
WHERE
key_id = 'aead49ac03dc6dad7564702cc05ec966671e45911015d0769232745541c24445'
AND (
token = 'KywRPui7aSpghZUfB6XxwdXysO/wsJmpp+6W/0MWMAA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)