UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZK823YsvDhCTMHsI4DBzkrXFfDWSYOG0IyKA/Mqbw50='
WHERE
key_id = '8424bf427888d6bf0f0a36af96042bed38929b443194d0eb6f9bb6d6f46f7b00'
AND (
token = 'ZK823YsvDhCTMHsI4DBzkrXFfDWSYOG0IyKA/Mqbw50='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)