UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xxmTLogdP6dvSXgAloOVCCqEaJkSpI2OE9NL1WwLwEQ='
WHERE
key_id = '2106b7eec397955b062883fa896b22035ce81801e8c6445d767b8a541e7b4ce3'
AND (
token = 'xxmTLogdP6dvSXgAloOVCCqEaJkSpI2OE9NL1WwLwEQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)