UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+8A1H7OXIjTrwGMzbil5+eb+f354t3qNJR1KC2ImIkk='
WHERE
key_id = 'c4c9bdb0bf4b6b6690d16220d8e442850df277299a75351c83c12ddc78fcfb65'
AND (
token = '+8A1H7OXIjTrwGMzbil5+eb+f354t3qNJR1KC2ImIkk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)