UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZJcNhzOdFFzwbgVZNi1qzKJ4bf1z5ITyPFSvIum1l1I='
WHERE
key_id = '1b90c13768ca347666bed3a215a239e74bb1dc00628ae4e0d43df6caed248d2c'
AND (
token = 'ZJcNhzOdFFzwbgVZNi1qzKJ4bf1z5ITyPFSvIum1l1I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)