UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b4r4ZdX4NDdhIJlr6Z2aKIBOHwT2nUj6qPvP7KZ7LKg='
WHERE
key_id = 'e43cda657412a84bfcbd643bebf559f4d5d357e33d4732c3cf5c486e8983c5e7'
AND (
token = 'b4r4ZdX4NDdhIJlr6Z2aKIBOHwT2nUj6qPvP7KZ7LKg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)