UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1rDgWF/Mzc0wMIPdU+nS0iRcHrPzZLAN1WYqTYi2Jjg='
WHERE
key_id = '220afe93931f83fb619dc3de96da8a999a983151a40fe5173a001d0fa029f197'
AND (
token = '1rDgWF/Mzc0wMIPdU+nS0iRcHrPzZLAN1WYqTYi2Jjg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)