UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0zkMVOf9+YXwYKOilkmUMAIqMyI3LW/g2vrsTYL/9gY='
WHERE
key_id = '22cc95fb3bfd37c11c2466e89ab403b19e14f491d82f986835e2b1378d50c119'
AND (
token = '0zkMVOf9+YXwYKOilkmUMAIqMyI3LW/g2vrsTYL/9gY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)