UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '317oVI26dg47hap9R/kOapP7d3xSciwpgvbCBRcYeAU='
WHERE
key_id = '5b198bcef04c67ed7cd43349e894b8441fcb2f473d6fa1050dbc36bdc9523690'
AND (
token = '317oVI26dg47hap9R/kOapP7d3xSciwpgvbCBRcYeAU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)