UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Oer/IKXQdjTOHnvZFrptShaNEw7OjSzQ9pTv2ikR6m8='
WHERE
key_id = '0b1c7d9399bd3d685ca83708b2ff45d43936f2fc2504f5953c1dd3a218c35984'
AND (
token = 'Oer/IKXQdjTOHnvZFrptShaNEw7OjSzQ9pTv2ikR6m8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)