UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A2X4cRJcyzAnKIfZZnQBaiYR/yp4qU6OXg6asKPUIlU='
WHERE
key_id = 'e660c897859dfd97eceb8da121e63dd89bc581c08695b121929cacd00ff08863'
AND (
token = 'A2X4cRJcyzAnKIfZZnQBaiYR/yp4qU6OXg6asKPUIlU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)