UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qtzaOJjbMFK/jalSN0mflthz6hL7UsIGCrf2hQqtGlA='
WHERE
key_id = '9f0a29586aa3f8a6994249acda6571842bf6813433ca5eea9a0d7a4559b24467'
AND (
token = 'qtzaOJjbMFK/jalSN0mflthz6hL7UsIGCrf2hQqtGlA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)