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