UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WZ69a5SPziQeTEWLx3t412IuY9pU0vv3dXISdPsi3hU='
WHERE
key_id = '719b8e3b070e326fd15dab0845ac68d790367cba8c67d3bce1d76bf3ba9d9559'
AND (
token = 'WZ69a5SPziQeTEWLx3t412IuY9pU0vv3dXISdPsi3hU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)