UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UfEdf2YmbUr8hxtrjlqsC4y2vPxniNAf8gPVKwlxzPo='
WHERE
key_id = '44069aaa67fca9a4621e6c273e41c6f54ff4f4fc2a9a761c0180dd169397c201'
AND (
token = 'UfEdf2YmbUr8hxtrjlqsC4y2vPxniNAf8gPVKwlxzPo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)