UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0VKZYTMMQ4eHNQhGn6P79QQQsIrBAJFHnzWv8hOHf98='
WHERE
key_id = '7396f887c245a8424d0cdfc84220a4969775ada86e03240c703ec7ee0d6e9553'
AND (
token = '0VKZYTMMQ4eHNQhGn6P79QQQsIrBAJFHnzWv8hOHf98='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)