UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mI1yhKC/T0BKnwwuGw3L/B/CU7EVcxYoGnW6if6Zurw='
WHERE
key_id = '9726b8a93f6eb595864b4a75e858315d537b97f9a31ecf4cb34053e19d85e55a'
AND (
token = 'mI1yhKC/T0BKnwwuGw3L/B/CU7EVcxYoGnW6if6Zurw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)