UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nGNPUnH4sWpX2Yb88MPsOla3rNmfnN93xYa9cRma3CY='
WHERE
key_id = '872558bbee1480c69dd9cf12b11e282987be1dee056d62ea3bbb0c47b1e86f7d'
AND (
token = 'nGNPUnH4sWpX2Yb88MPsOla3rNmfnN93xYa9cRma3CY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)