UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PgIftVav7jY8I7IjhLA6kM+ySG+UmTC+5QpAfFzbDUg='
WHERE
key_id = '8956714d1710ca18c45617c36cbbbf45b89fd2558ad7e992760022dacdb0b1f8'
AND (
token = 'PgIftVav7jY8I7IjhLA6kM+ySG+UmTC+5QpAfFzbDUg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)